<%@ page language="java" import="b.News,java.util.Iterator,org.apache.commons.lang3.StringEscapeUtils,d.DBUtils" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="Content-Script-Type" content="text/javascript" />
		<meta http-equiv="Content-Style-Type" content="text/css" />
		<title>News List</title>

		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/main.css" />
		<style type="text/css" media="all">
		.m_list table {
			border-collapse:collapse;
			font-size:0.85em;
		}
		
		.m_list table td {
			padding:2px 8px;
		}
		</style>
	</head>

	<body>
	<ul class="m_buttonbar" style="margin-top:4px;">
		<li class="m_bb_0" onclick="javascript:window.location.href='create'">新建</li>
		<li class="m_bb_n">删除</li>
	</ul>
	<div class="m_list">
		<table>
			<tr><td>标题</td><td>创建者</td><td>创建时间</td></tr>
		<%	@SuppressWarnings("unchecked")
			Iterator<News> list = (Iterator<News>)request.getAttribute("Entities");
			News news;
			boolean odd=true;
			while(list.hasNext()&&(news=list.next())!=null) {%>
			<tr class="<%=(odd=!odd)?"odd":""%>">
				<td><a href="<%=news.getId()%>" target="_self"><%=StringEscapeUtils.escapeHtml4(news.getTitle())%></a></td>
				<td><%=news.getCreatorName()%></td>
				<td><%=DBUtils.dateFormat.format(news.getCreatedOn())%></td>
			</tr>
		<%	}%>
		</table>
	</div>
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.6.2.min.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/nicEdit.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/utils.js"></script>
	<script type="text/javascript">


		$(document).ready(function(){

		});
	</script>
	</body>
</html>